package se.webbzon.boltzmann.effect;

import se.webbzon.boltzmann.game.character.AbstractCharacter;
import se.webbzon.oschi01.worldarea.WorldArea;

public class CharacterDefeatingEffect extends CharacterEffect {

	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a new character defeating effect. **/
	public CharacterDefeatingEffect(AbstractCharacter character, int duration) {
		super(character, duration);
		
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public void onEffectBegin(WorldArea world) {
		new CharacterDamageEffect(getCharacter(),getStartupDuration()).launch(world);
		new CharacterSpinningEffect(getCharacter(),getStartupDuration()).launch(world);
		new CharacterShrinkingEffect(getCharacter(),getStartupDuration()).launch(world);
	}

	@Override public void onEffectStep(WorldArea world) {};

	@Override public void onEffectEnd(WorldArea world) {
		world.destroyInstance(getCharacter());
	}

}
